/**
 * Created by Admin on 2017/12/26.
 */
define(function(require,exports,module){
    $.fn.serializeObject = function(){
        var o = {};
        var a = this.serializeArray();
        var $chk = this.find("input[type='checkbox']");
        if($chk.length){
            $chk.map(function(index,item){
                if( this.name && !this.checked){
                    a.push({
                        name:this.name
                    })
                }
            });
        }
        $.each(a,function(){
            if(o[this.name]){
                if(!o[this.name].push){
                    o[this.name] = [o[this.name]];
                }
                o[this.name].push(this.value || "");
            }else{
                o[this.name] = this.value || "";
            }
        });
        return o;
    }
})